package com.ygqh.baby.po;

import java.math.BigDecimal;
import java.util.Date;

import com.ygqh.baby.ao.DataStatus;
import com.ygqh.baby.ao.JobStatus;
import com.ygqh.baby.model.BmdismModel;

public class YgBmdism {
	private Long id;

	private String title;

	private Integer buyCount;

	private BigDecimal disCount;

	private String productIds;

	private Date startTime;

	private Date endTime;

	private String remark;

	private String createBy;

	private Date createTime;

	private String updateBy;

	private Date updateTime;

	private DataStatus status;

	public String getJobStatus() {
		long millis = System.currentTimeMillis();
		if (millis - startTime.getTime() < 0) {
			return JobStatus.UnStart.getTitle();
		}
		if (millis - endTime.getTime() >= 0) {
			return JobStatus.Complete.getTitle();
		}
		return JobStatus.Running.getTitle();
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title == null ? null : title.trim();
	}

	public Integer getBuyCount() {
		return buyCount;
	}

	public void setBuyCount(Integer buyCount) {
		this.buyCount = buyCount;
	}

	public BigDecimal getDisCount() {
		return disCount;
	}

	public void setDisCount(BigDecimal disCount) {
		this.disCount = disCount;
	}

	public String getProductIds() {
		return productIds;
	}

	public void setProductIds(String productIds) {
		this.productIds = productIds == null ? null : productIds.trim();
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark == null ? null : remark.trim();
	}

	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy == null ? null : createBy.trim();
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy == null ? null : updateBy.trim();
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public DataStatus getStatus() {
		return status;
	}

	public void setStatus(DataStatus status) {
		this.status = status;
	}

	public BmdismModel cloneModel() {
		return new BmdismModel(id, title, buyCount, disCount, startTime, endTime, productIds);

	}

	@Override
	public String toString() {
		return "YgBmdism [id=" + id + ", title=" + title + ", buyCount=" + buyCount + ", disCount=" + disCount + ", productIds=" + productIds + ", startTime="
				+ startTime + ", endTime=" + endTime + ", remark=" + remark + ", createBy=" + createBy + ", createTime=" + createTime + ", updateBy="
				+ updateBy + ", updateTime=" + updateTime + ", status=" + status + "]";
	}

}